/*
 * G4SipmConfigFileVoltageTraceModel.cc
 *
 * @created Apr 29, 2013
 * @author Tim Niggemann, III Phys. Inst. A, RWTH Aachen University
 * @copyright GNU General Public License v3.0
 */

#include "model/impl/G4SipmConfigFileVoltageTraceModel.hh"

#include "Properties.hh"

G4SipmConfigFileVoltageTraceModel::G4SipmConfigFileVoltageTraceModel(std::string filename) : G4SipmVoltageTraceModel()
{
	Properties p;
	if (!p.load(filename))
	{
		throw 1;
	}
	// Set properties.
	// 设置波形参数
	amplitude = p.getNumber("voltageTrace-amplitude");
	tauRise = p.getNumber("voltageTrace-tauRise");
	tauFall = p.getNumber("voltageTrace-tauFall");
	v0 = p.getNumber("voltageTrace-v0");
	whiteNoiseSigma = p.getNumber("voltageTrace-whiteNoiseSigma");
	timeBinWidth = p.getNumber("voltageTrace-timeBinWidth");
	precision = p.getNumber("voltageTrace-precision");
}
// 获取电压波形峰值幅度，单位：V
double G4SipmConfigFileVoltageTraceModel::getAmplitude() const
{
	return amplitude;
}
// 获取电压波形上升时间常数，单位：ns
double G4SipmConfigFileVoltageTraceModel::getTauRise() const
{
	return tauRise;
}
// 获取电压波形下降时间常数，单位：ns
double G4SipmConfigFileVoltageTraceModel::getTauFall() const
{
	return tauFall;
}
// 获取电压波形基线值，单位：V
double G4SipmConfigFileVoltageTraceModel::getV0() const
{
	return v0;
}
// 获取电压波形白噪声标准差
double G4SipmConfigFileVoltageTraceModel::getWhiteNoiseSigma() const
{
	return whiteNoiseSigma;
}
// 获取电压波形精度（小数点后位数）
int G4SipmConfigFileVoltageTraceModel::getPrecision() const
{
	return precision;
}
// 获取电压波形时间分辨率，单位：ns
double G4SipmConfigFileVoltageTraceModel::getTimeBinWidth() const
{
	return timeBinWidth;
}
